﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Drawing;


namespace Client
{
    class wizz
    {
        private Form f;
        private Timer t;
        public wizz(Form f)
        {
            this.f = f;
            t = new Timer();
        }

  public void doWizz()
        {//simule le wizz de msn
            t.Interval = 50;//interval pour le timer
            t.Tick += new EventHandler(wizztim);
            t.Start();     
        }

private void wizztim(object sender, EventArgs e)
        {
            int value = 5;
            for (int i = 0; i < 200; i++)
            {
                f.DesktopLocation = new Point(f.Location.X + value, f.Location.Y + value);
                f.Refresh();

                f.DesktopLocation = new Point(f.Location.X - value, f.Location.Y - value);
                f.Refresh();

                f.DesktopLocation = new Point(f.Location.X + value, f.Location.Y - value);
                f.Refresh();

                f.DesktopLocation = new Point(f.Location.X - value, f.Location.Y + value);
                f.Refresh();
            }
            t.Stop();
            t.Dispose();
        }
    }
}
